-extends "base_objects/show.haml"

-block title
  GRC Program: ={ instance.title }

-block header
  .breadcrumbs-holder
    %ul.breadcrumbs
      %li
        %a{ 'href': '={ url_for("dashboard") }' }
          Dashboard
      %li
        %span
          =instance.title

  %h1.programs
    -if instance.company_controls
      .grcobject.governance{ 'rel': "tooltip", 'data-placement': "bottom", 'title': "Program" }
        %i.grcicon-control
    -else
      .grcobject.programs{ 'rel': "tooltip", 'data-placement': "bottom", 'title': "Program" }
        %i.grcicon-program
    %span
      %strong Program:
    =instance.title

-block subheader_extras
  %ul.actions.pull-right
    -if instance.company_controls
      %li
        %a{ 'href': "#", 'class': "disabled"}
          %i.grcicon-reg-map
          %span Consolidate Controls
    -else
      %li
        %a{ 'href': "new_flow_cycle_path(program_id => instance.id)", 'data-toggle': 'modal-ajax-form', 'data-modal-reset': 'reset', 'data-form-target': 'redirect' }
          %i.grcicon-audit
          %span Start Audit
    %li
      %a{ 'href': "edit_flow_program_path(instance)", 'data-toggle': 'modal-ajax-form', 'data-modal-reset': 'reset', 'data-form-target': 'refresh', 'data-modal-class': 'modal-wide', 'title': 'Edit Program' }
        %i.grcicon-edit
        %span Edit Program


-block subheader_plus
  %a.navbarplus.fltrt{ 'href': "new_flow_program_path", 'data-toggle': 'modal-ajax-form', 'data-form-target': 'redirect', 'data-modal-reset': 'reset', 'data-modal-class': 'modal-wide' }

-block main
  .container-fluid
    #columns.row-fluid{ 'data-resize': "true" }
      #middle-column.span8.widget-area
        -with widget_class = 'widget-tabs widget-tabs-horizontal programs'
          -include 'programs/_main.haml'
        -if not instance.company_controls
          -with widget_class = 'widget-tabs widget-tabs-horizontal related business'
            -include 'shared/_related.haml'
        -if instance.company_controls
          -with widget_class = 'widget-tabs widget-tabs-horizontal programs'
            -include 'programs/_linked_programs.haml'
        -else
          -include 'shared/_add_widget_section.haml'

      #right-column.span4.widget-area
        -with widget_class = 'programs'
          -include 'programs/_info.haml'
        -if not instance.company_controls
          -with widget_class = 'programs'
            -include 'programs/_audit_cycles.haml'
        -with widget_class = 'related business'
          -include 'programs/_more_info.haml'
        -if not instance.company_controls
          -include 'shared/_add_widget_section.haml'
